package com.huisang.dao.user;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;


import com.huisang.pojo.User;

public interface UserDao {
    
    //得到要登录的用户
    public User getLoginUser(Connection connection,String userCode,String userPassword) throws SQLException;

    //修改当前用户的密码
    public int updatePwd(Connection connection,int id,String userPassword) throws SQLException;

    //查询用户总数
    public int getUserCount(Connection connection,String userName,int userRole) throws SQLException;

    //获取用户列表
    public List<User> getUserList(Connection connection,String userName,int userRole,int currentPageNo,int pageSize) throws SQLException;

    //查询当前用户是否存在
    public boolean boUser(Connection connection,String queryUserCode) throws SQLException;
    //添加一个用户
    int add(Connection connection, User user) throws Exception;
    //通过用户id获得用户
    User getUserById(Connection connection, String id) throws Exception;
    //修改用户资料
    int modify(Connection connection, User user) throws Exception;
    //删除用户资料
    int deleteUserById(Connection connection, Integer delId) throws Exception;
}
